package prototype.improve;

import lombok.Data;
import lombok.ToString;

/**
 * 羊
 * @author DFD
 * @date 2023年11月13日
 */
@Data
@ToString
public class Sheep implements Cloneable {
	private String name;
	private int age;
	private String color;
	private Sheep friend;

	public Sheep(String name, int age, String color) {
		super();
		this.name = name;
		this.age = age;
		this.color = color;
	}

	/**
	 * 使用默认的clone方法来实现
	 */
	@Override
	protected Sheep clone() throws CloneNotSupportedException {
		Sheep sheep = null;
		try {
			sheep = (Sheep) super.clone();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return sheep;
	}
}
